/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI.administrador;

import GUI.Actualiza_Alumno;
import GUI.AlumnoPanel;
import GUI.Codigo;
import GUI.Opciones;
import GUI.PanelView;
import GUI.forAlumno;
import GUI.formAdministrador;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;

/**
 *
 * @author Administrator
 */
public class FramePrincipalAdm  extends JFrame{

    public FramePrincipalAdm() {
        setSize(500, 400);
        setTitle("Trabajo final  :D");
        
        final PanelView panel = new PanelView();
        final Opciones pn1 = new Opciones();
        final forAlumno pn2 = new forAlumno();
        final Actualiza_Alumno pn3 = new Actualiza_Alumno();
        final Codigo pn4 = new Codigo();
        final AlumnoPanel pn5 = new AlumnoPanel();


        JButton temp = pn1.getjButton1();
        temp.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                panel.set(pn2);
            }
        });
        /*
        JButton temp2 = pn4.getjButton1();
        temp2.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                panel.set(pn2);
            }
        });
         */
        JButton temp3 = pn2.getjButton1();
        temp3.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                panel.set(pn5);//noooooooooolooooooo panel
            }
        });

        JButton temp4 = pn2.getjButton2();
        temp4.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                panel.set(pn4);
            }
        });
         JButton temp2 = pn4.getjButton1();
        temp2.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                panel.set(pn3);
            }
        });


        panel.set(pn1);

        JTabbedPane pestana = new JTabbedPane();
        pestana.add("Informacion General",new formAdministrador());
        pestana.add("Mantenimiento",panel);
        add(pestana);
        pestana.setSelectedIndex(0);

        
    }
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {

            public void run() {
                JFrame frame = new FramePrincipalAdm();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setVisible(true);
            }
        });
    }

}
